package com.im.app.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.im.app.model.Conversations;
import com.im.app.utils.ResponseResult;

import java.util.List;

public interface ConversationsService extends IService<Conversations> {

    int insert(Conversations conversations);

    Conversations selectByGroup(String ownerUserId,String groupId);

    List<Conversations> selectByGroupId(String groupId);

    Conversations selectByUser(String ownerUserId,String userId);

    void update(Conversations conversations);

    int updateCon(String userId,String nickName,String avatar);

    void updateCacheGroup(List<Conversations> conversationsList,String groupId);

    int updateIsPinned(Integer isPinned, String conversationId);

    int updateIsBlack(Integer isBlack,String ownerUserId,String userId);

    int updateNick(String nickName, String conversationId);

    int clearUnreadCount(String conversationId);

    List<Conversations> getConversationsList(String ownerUserId);

    List<Conversations> getConversationByKeyWord(String ownerUserId,String keyWord);

    int clearConversations(String conversationId);

    int clearByDays(String userId,Integer days);

    int clearByDaysOut(Integer days);

    int clearByUserIdsOut(String ids);

    Conversations selectLastMessage(String conversationId);

    ResponseResult<Object> createConversation(String ownerUserId, Integer type, String id);
}

